<div id="form"></div>
<script>
var frm=$("#form").ajajform({
	header: null
});
var grid=frm.ajajform("insertWidget",null,null,{
	type: "grid",
	title: "{{!title}}",
	name: "guestbooks",
	rowClasses: [{
		name:"guestbook",
		columns: [
			{name: "code", label: "{{!col_code}}", width: 150, url: '{{action}}?mode=list&guestbook_id='},
			{name: "name", label: "{{!col_name}}", width: 300, url: '{{action}}?mode=list&guestbook_id='},
			{name: "premoderation", label: "{{!col_premoderation}}", width: 100, type: "checkbox"},
			{name: "email", label: "{{!col_email}}", width: 100}
		]
	}]
});
var guestbooks={{JSON:guestbooks}};
for (var i=0;i<guestbooks.length;i++) {
	var t=guestbooks[i];
	grid.ajajform_grid("insertRow",null,{rowClass: "guestbook",cells:[t.code,t.name,t.premoderation,t.email],id:t.id});
}
</script>

